1. Field of the Invention
The present invention relates to a method of and an apparatus for processing a digital image which is obtained from a scanner, a digital camera or other apparatuses.
2. Description of the Background Art
A printed matter is customarily created by printing halftone dots. A printed matter which is printed in halftone dots has a resolution of about 65 to 200 dpi.
FIG. 11 shows a case that an image inputting portion such as a scanner reads a printed matter which is printed in halftone dots. FIG. 11 is a view of a positional relationship between halftone dots and pixels which are to be read, and the illustrated halftone dot image which is an original image has a density of 50%. In other words, the shadowed regions in FIG. 11 are a portion where halftone dots are recorded. Now, a description will be given on a case where such an original image is read as pixels P1 to P8 whose size is indicated as the dotted frames.
The size of one pixel shown in FIG. 11 is about 87.5% of the size of one halftone dot. In such a case, densities which are measured in the pixels P4 and P5 are 50% which is the same as the density of the original image, and therefore, a consistency is ensured. However, densities which are measured in the pixels P1 and P8 are higher than 50% since much blackened region where the halftone dot is blackened is contained in a pixel region of each one of the pixels P1 and P8. In reality, the densities in the pixels P1 and P8 are about 62%. Meanwhile, densities which are measured in the pixels P2, P3, P6 and P7 are also higher than 50%. Thus, the densities which are measured in the pixels P1, . . ., P8 periodically change between 50% and about 62%. Considering that the density of the original image is 50%, this is a deterioration in the quality of the image.
A cause of this is interference which is created due to differences between the halftone dot size of the original image and the pixel size of the pixels which are to be read. Hence, as the pixel size becomes smaller than the halftone dot size, the densities of the halftone dots are read rather than the density of the original image are read, which leads to greater changes in the density between the pixels. Further, when the pixel size is close to the halftone dot or in a similar situation, a cycle of the density change becomes longer, which appears as moires which are visually noticeable.
Moires are noticeable where a density level is flat. In reality, although moires are not very noticeable in a middle density range where a density is 50%, moires appear remarkably noticeable in a high density range where a density is higher or in a low density range where a density is lower and degrades the quality of an image.
The phenomenon described above occurs also when a similar condition to the above is satisfied regarding a relationship between a pixel size and a pattern of a general original image which is expressed by other method except for halftone dots, a pattern of an object, or the like. In short, in some cases, moires are created from an image which is obtained by reading a transparent original or a reflective original with a scanner and from an image which is obtained with a digital camera.
To eliminate moires and prevent a deterioration in the quality of an image, image processing using an image filter is customarily performed.
FIG. 12 is a schematic structure diagram of a conventional image processing apparatus. After inputted, a main signal S regarding a pixel which is to be processed (hereinafter an "objective pixel") is supplied to a filter computation portion 401 and a main signal adjusting portion 402. The filter computation portion 401 subjects the main signal S to filter computation which is performed by a two-dimensional image filter, whereby a filtered signal S' is generated. Following this, the main signal adjusting portion 402 generates a signal Sa (=M.multidot.S) which is equal to the main signal S as it is multiplied by M, based on a mixing rate M which is set in advance with respect to the main signal S, where M is a figure which satisfies "0.ltoreq.M&lt;1". On the other hand, the filtered signal S' which is generated by the filter computation portion 401 is processed into a signal Sb (=(1-M).multidot.S') which is equal to the filtered signal S' as it is multiplied by (1-M), based on a mixing rate (1-M) which is set to a filtered signal adjusting portion 403 in advance with respect to the filtered signal S'. An adder 404 mixes (adds) the signal Sa from the main signal adjusting portion 402 with the signal Sb from the filtered signal adjusting portion 403, and accordingly generates an output signal S".
In such a conventional image processing apparatus described above, for the purpose of removing moires and preventing a deterioration in the quality of an image, the filter computation portion 401 executes filter computation using an image filter which has a predetermined size. FIG. 13 shows one example of an image filter which is used at this stage. In such a conventional image processing apparatus, the size of an image filter is set about double the size of or larger than the size of each halftone dot. Hence, in the case of the image filter which is shown in FIG. 13, for example, the size of one pixel is about 2/5 of or larger than the size of halftone dots. In the conventional image processing apparatus, the filter computation portion 401 aligns the center of the image filter to an objective pixel, calculates a weighted mean of the respective density values in accordance with weighting factors which are assigned to the objective pixel and surrounding pixels around the same, and outputs the weighted mean as the filtered signal S'. That is, to calculate a weighted mean in an area which is larger than the size of the halftone dots, a frequency component of a halftone dot pattern is removed from the filtered signal S', and therefore, the filtered signal S' has a density value from which an influence of the size of the halftone dots is removed. Hence, a cause of moires and a deterioration in an image quality is removed from the filtered signal Since the main signal S and the filtered signal S' are mixed with each other at a mixing ratio of M:(1-M), the smaller the value of the mixing rate M is, the larger the mixing rate (1-M) for the filtered signal S' is, so that a rate at which the filtered signal S' is reflected in the output signal S" becomes larger. In other words, the effect of the image processing using the image filter is dependent upon the mixing rate M which is set in advance.
While it is possible for an operator to set the value of the mixing rate M before starting the image processing, once the processing of an original image is started, the value of the mixing rate M remains fixed until the processing completes.
By the way, in general, an edge portion of an image of a printed matter which is recorded in halftone dots is reproduced with a higher resolution than a halftone dot size. FIGS. 14A, 14B and 14C are explanatory diagrams showing a conventional method of generating one halftone dot. As shown in FIG. 14A, a region which indicates the size of one halftone dot is divided into four blocks B1, . . ., B4, and each block is further divided into blackened regions. A threshold value is set for each blackened region, as shown in FIG. 14A. On the other hand, when a density value which is obtained by reading an original image is "20" at positions which correspond to the blocks B1 and B4 but "10" at positions which correspond to the blocks B2 and B3 as shown in FIG. 14B, the density value is compared with the threshold values which are shown in FIG. 14A and the regions are blackened one by one, starting at the center of the halftone dot. In this manner, the halftone dot as that shown in FIG. 14C is recorded.
FIG. 15 shows a case where an edge portion of an image is recorded by such a recording method. FIG. 15 illustrates an edge portion of a halftone dot image, and the dotted line in FIG. 15 indicates an edge of the image. The right-hand side of the dotted line is where a density is 50%, while the left-hand side of the dotted line is where a density is 0%. Square areas which are defined by the lattice respectively indicate the respective halftone dot regions. As shown in FIG. 15, since halftone dots are recorded in accordance with density values which correspond to the respective four divided blocks in the edge portion of the halftone dot image, the image is reproduced with a high resolution. A middle density range of an original image contains relatively many such edge portions of the halftone dot image which are reproduced with a high resolution.
However, while the conventional image processing apparatus executes smoothing using the image filter as that shown in FIG. 13 for the purpose of avoiding moires and a deterioration in the quality of an image, since the mixing ratio of M:(1-M) for mixing the main signal S and the filtered signal S' with each other is always constant regardless of a density range of an image during generation of the output signal S", and further, since the mixing ratio of M:(1-M) is always constant over the entire one image, such an edge portion of the image above which is reproduced with a high resolution as well is smoothed out and smudged.